package com.mmr.dxp.mapper;

import com.mmr.dxp.domain.RdsResourceApprovalSuggest;
import com.mmr.dxp.domain.RdsResourceObject;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RdsResourceApprovalMapper {
    @Select("SELECT ID,RESOURCE_ID FROM RDS_RESOURCE_APPROVAL_SUGGEST WHERE ID = #{id}")
    @Results(id="rdsApproveMap", value={
            @Result(column="id", property="id", jdbcType= JdbcType.VARCHAR, id=true),
            @Result(column="RESOURCE_ID", property="resource", javaType= RdsResourceObject.class,
                    one=@One(select="com.tongtech.blockchain.dxp.mapper.RdsResourceMapper.selectByPrimaryKey"))
    })
    RdsResourceApprovalSuggest selectByPrimaryKey(String id);
}
